﻿namespace EyeOpen.TimeAssistant.UI.Silverlight
{
    using System.Diagnostics;
    using System.Windows;

    public partial class App
    {
        public App()
        {
            Startup += Application_Startup;
            UnhandledException += Application_UnhandledException;

            InitializeComponent();
        }

        private void Application_Startup(object sender, StartupEventArgs e)
        {
            new Bootstrapper().Run();
        }

        private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
        {
            // If the app is running outside of the debugger then report the exception using
            // the browser's exception mechanism. On IE this will display it a yellow alert 
            // icon in the status bar and Firefox will display a script error.
            if (!Debugger.IsAttached)
            {
                e.Handled = true;
            }
        }
    }
}
